package cn.hd01.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import cn.hd01.repository.CitiesRepository;
import cn.hd01.repository.entity.Areas;
import cn.hd01.repository.entity.Cities;
import cn.hd01.repository.entity.Provinces;
import cn.hd01.service.CitiesService;

@Service
public class CitiesServiceImpl extends BaseServiceImpl<Cities, Integer> implements CitiesService {

	private CitiesRepository repository;

	@Autowired
	public CitiesServiceImpl(CitiesRepository repository) {
		super(repository);
		this.repository = repository;
	}

	@Override
	@Cacheable(value="citiesCache")
	public List<Cities> findByProvinceId(Integer provinceId) {
		return repository.findByProvinceId(provinceId);												
	}

}
